﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script type="text/javascript">
        window.onload = function () {
            //01.匹配数值
            var core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/;
 
            //02.匹配空格
            var core_rnotwhite = /\S+/g;
            var ret = core_rnotwhite.exec("123 1123 asd 23  asd");  //123
            ret = "123 1123 asd 23  asd".match(core_rnotwhite);//[123,1123,asd,23,asd]

            //匹配html标签和id选择器
            var rquickExpr = /^(    ?:  \s*(<[\w\W]+>)[^>]*   |#([\w-]*)   )$/;
            ret = rquickExpr.exec("  <table>"); 
            ret = rquickExpr.exec("#1ds-sd");

            //匹配一个独立的html标签:<abc/> 或者<abc></abc>
            var rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/;
            ret = rsingleTag.exec("<abc/>");
            ret = rsingleTag.exec("<abc></abc>");

            //匹配前缀
            var rmsPrefix = /^-ms-/;
            var rdashAlpha = /-([\da-z])/gi;
            console.log(ret);
        }
    </script>
</head>
<body>
    
</body>
</html>
